home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / tutorials / custEducation / opengl1 / include / aux.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  5.9 KB  |  173 lines

  1. /*
  2.  * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
  3.  * ALL RIGHTS RESERVED 
  4.  * Permission to use, copy, modify, and distribute this software for 
  5.  * any purpose and without fee is hereby granted, provided that the above
  6.  * copyright notice appear in all copies and that both the copyright notice
  7.  * and this permission notice appear in supporting documentation, and that 
  8.  * the name of Silicon Graphics, Inc. not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission. 
  11.  *
  12.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  13.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  14.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  15.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  16.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  17.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  18.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  19.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  20.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  21.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  22.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  23.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  * 
  25.  * US Government Users Restricted Rights 
  26.  * Use, duplication, or disclosure by the Government is subject to
  27.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  28.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  29.  * clause at DFARS 252.227-7013 and/or in similar or successor
  30.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  31.  * Unpublished-- rights reserved under the copyright laws of the
  32.  * United States.  Contractor/manufacturer is Silicon Graphics,
  33.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  34.  *
  35.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  36.  */
  37. #ifndef __aux_h__
  38. #define __aux_h__
  39.  
  40. #include <X11/Xlib.h>
  41. #include <X11/Xutil.h>
  42. #include <X11/keysym.h>
  43. #include <GL/gl.h>
  44. #include <GL/glu.h>
  45. #include <stdlib.h>
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. #include <auxDevice.h>
  50. #include <auxToolkit.h>
  51.  
  52.  
  53.  
  54. /**************************************************************************
  55.  *    Global Defines
  56.  **************************************************************************/
  57. /*
  58. ** ToolKit Window Types
  59. */
  60.  
  61. #define AUX_RGB          (1<<1)
  62. #define AUX_RGBA         AUX_RGB
  63. #define AUX_INDEX        (1<<2)
  64. #define AUX_SINGLE       (1<<3)
  65. #define AUX_DOUBLE       (1<<4)
  66. #define AUX_DEPTH        (1<<5)
  67. #define AUX_STENCIL      (1<<6)
  68. #define AUX_ACCUM        (1<<7)
  69. #define AUX_AUX          (1<<8)
  70. #define AUX_ALPHA        (1<<9)
  71.  
  72. /*
  73. ** Prototypes
  74. */
  75.  
  76. extern void auxInitDisplayMode(GLenum mode);
  77. extern void auxInitPosition(int x, int y, int width, int height);
  78. extern void auxInitWindow(char *title);
  79. extern void auxCloseWindow(void);
  80.  
  81. extern void auxQuit(void);
  82. extern void auxSwapBuffers(void);
  83.  
  84. extern Display *auxXDisplay(GLvoid);
  85. extern Window auxXWindow(GLvoid);
  86.  
  87. extern void auxMainLoop(void (*drawScene)());
  88. extern void auxExposeFunc(void (*function)(GLsizei width, GLsizei height));
  89. extern void auxReshapeFunc(void (*function)(GLsizei width, GLsizei height));
  90. extern void auxIdleFunc(void (*function)());
  91. extern void auxKeyFunc(int key, void (*function)());
  92. extern void auxMouseFunc(int button, int mode, void (*function)(AUX_EVENTREC *));
  93.  
  94. extern int  auxGetColorMapSize(void);
  95. extern void auxGetMouseLoc(int *x, int *y);
  96. extern void auxSetOneColor(int index, float red, float green, float blue);
  97. extern void auxSetFogRamp(int , int);
  98. extern void auxSetGreyRamp(void);
  99. extern void auxSetRGBMap(int, float *);
  100.  
  101. /* this function only works properly with images sized 2^m x 2^n */
  102. extern AUX_RGBImageRec *auxRGBImageLoad(char *);
  103.  
  104. extern void auxCreateFont(void);
  105. extern void auxDrawStr(char *);
  106.  
  107. extern void auxWireSphere(GLdouble);
  108. extern void auxSolidSphere(GLdouble);
  109. extern void auxWireCube(GLdouble);
  110. extern void auxSolidCube(GLdouble);
  111. extern void auxWireBox(GLdouble, GLdouble, GLdouble);
  112. extern void auxSolidBox(GLdouble, GLdouble, GLdouble);
  113. extern void auxWireTorus(GLdouble, GLdouble);
  114. extern void auxSolidTorus(GLdouble, GLdouble);
  115. extern void auxWireCylinder(GLdouble, GLdouble);
  116. extern void auxSolidCylinder(GLdouble, GLdouble);
  117. extern void auxWireIcosahedron(GLdouble);
  118. extern void auxSolidIcosahedron(GLdouble);
  119. extern void auxWireOctahedron(GLdouble);
  120. extern void auxSolidOctahedron(GLdouble);
  121. extern void auxWireTetrahedron(GLdouble);
  122. extern void auxSolidTetrahedron(GLdouble);
  123. extern void auxWireDodecahedron(GLdouble);
  124. extern void auxSolidDodecahedron(GLdouble);
  125. extern void auxWireCone(GLdouble, GLdouble);
  126. extern void auxSolidCone(GLdouble, GLdouble);
  127. extern void auxWireTeapot(GLdouble);
  128. extern void auxSolidTeapot(GLdouble);
  129.  
  130. /*
  131.  * OpenGL Programming Class Library extensions
  132.  */
  133.  
  134. #define AUX_OFF          GL_FALSE
  135. #define AUX_ON           GL_TRUE
  136.  
  137. /* --- Window Functions allow use of multiple windows --- */
  138.  
  139. extern GLvoid    auxWinSet( GLint );
  140. extern GLint     auxWinGet( GLvoid );
  141. extern GLvoid    auxWinClose( GLint );
  142. extern void      auxKeepAspect(int width, int height);
  143.  
  144. /* --- Event Processing Functions --- */
  145.  
  146. extern GLboolean auxEventPending( GLvoid );
  147. extern GLint     auxReadEvent( GLint *, GLint *, GLint * );
  148.  
  149. /* --- Toolkit Functions --- */
  150.  
  151. extern GLvoid    auxDeleteMouseFunc( GLint, GLint, GLvoid (*)(AUX_EVENTREC *) );
  152. extern GLvoid    auxDeleteAllMouseFunc( GLint, GLint );
  153. extern GLvoid    auxAnimation( GLboolean );
  154. extern GLvoid    auxDispatchEvent( GLint );
  155.  
  156. /* --- Miscellanous Functions --- */
  157.  
  158. extern GLvoid    auxGetSize( GLsizei *, GLsizei * );
  159. extern GLvoid    auxGetOrigin( GLint *, GLint * );
  160. extern GLvoid    auxGetScreenSize( GLsizei *width, GLsizei *height );
  161.  
  162. /* --- Text Functions --- */
  163.  
  164. extern GLint     auxNewFont( char * );
  165. extern GLvoid    auxRenderFontString( GLint, char * );
  166. extern GLint     auxFontStringLength( GLint, char * );
  167.  
  168. #ifdef __cplusplus
  169. }
  170. #endif
  171.  
  172. #endif /* __aux_h__ */
  173.